/* eslint-disable @typescript-eslint/no-var-requires */
const HandleBars = require('handlebars')
const viewGenerator = require('./plop-templates/view/prompt')
const componentGenerator = require('./plop-templates/component/prompt')

HandleBars.registerHelper('getName', function (name) {
  const strs = name.split('-').map(item => {
    return item.replace(/^./, t => t.toUpperCase())
  })
  return strs.join('')
})

module.exports = function (plop) {
  plop.setGenerator('view', viewGenerator)
  plop.setGenerator('component', componentGenerator)
}
